import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

const app = createApp(App)

// antd
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'

// scrollbar
import PerfectScrollbar from 'vue3-perfect-scrollbar'
import 'vue3-perfect-scrollbar/dist/vue3-perfect-scrollbar.css'

//默认样式
import './styles/index.less'
//路由权限
import './permission'
// 自定义指令操作按钮
import './btnPermission'

//全局请求方法
import { _get, _post, _all } from './api/http.js'
app.config.globalProperties._get = _get
app.config.globalProperties._post = _post
app.config.globalProperties._all = _all

//icon全局组件
import SvgIcon from './components/SvgIcon'
app.component('svg-icon', SvgIcon)
const requireAll = (requireContext) => requireContext.keys().map(requireContext)
const req = require.context('./assets/svg', false, /\.svg$/)
requireAll(req)

app.use(Antd).use(router).use(PerfectScrollbar).use(store).mount('#app')
